home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 3_0 / CUTILSLI / UTILITYL / PSTRCOPY.C < prev    next >
Text File  |  1987-11-10  |  1KB  |  29 lines

  1.     /*********************************************
  2.     *    Filename:    pStrCopy.c                                                                
  3.     *    Purpose:    Pascal String Copy                                                
  4.     *    Authors:    Robert E. Neville                                                        
  5.     *    Date:        November 5, 1987                                                        
  6.     *    Functions:    pStrCopy().                                                                                        
  7.     *    Version        1.0                                                                            
  8.     *    Copyright    1987    Hummingbird Graphics                                        
  9.     *********************************************/
  10.  
  11.     /****************************************************************
  12.     *    Function:    pStrCopy(p1,p2)
  13.     *    Purpose:    Copy contents of String 1 to String 2
  14.     *    Passed:        p1    -    Ptr to Str1 
  15.                 p2    -    Ptr to String 2
  16.     *    Returned:    Nothing.
  17.     *****************************************************************/
  18.  
  19.     pStrCopy(p1, p2)
  20.     register char    *p1, *p2;            /* Ptrs to p1 and p2 */
  21.     {
  22.         register int    len;            /* The length of string */
  23.     
  24.         len = *p2++ = *p1++;            /* Get the number of chars */
  25.         while(--len >= 0)                /* While string length more than 0 */
  26.             *p2++ = *p1++;                /* Move the next char of p1 to p2 */
  27.     }
  28.  
  29.     /**********     End of File     **********/